package com.yihen.dto;

import lombok.Data;

// 返回数据类型
@Data
public class Result {
    // 返回数据
    private Object data;
    // 是否成功
    private boolean success;
    // 错误信息
    private String message;

    public Result(Object data) {
        this.data = data;
        this.success = true;
    }

    public Result(String message) {
        this.success = false;
        this.message = message;
    }

    public Result(Object data, boolean success, String message) {
        this.data = data;
        this.success = success;
        this.message = message;
    }

    @Override
    public String toString() {
        return "Result{" +
                "data=" + data +
                ", success=" + success +
                ", message='" + message + '\'' +
                '}';
    }
}
